/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.feriaderemates.dao.user;

import com.feriaderemates.domain.userAccount.UserFeedback;
import com.feriaderemates.domain.userAccount.UserFeedbackLevel;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author Lenovo
 */
public class UserFeedbackrowMapper implements RowMapper {

    public Object mapRow(ResultSet rs, int i) throws SQLException {
        
        UserFeedback userFeedback = UserFeedback.createUserFeedbackToShow(rs.getInt("user_feedback_id"),
                rs.getString("comments"), 
                rs.getLong("listing_id"), 
                rs.getTimestamp("date"),
                 rs.getString("description"),
                 rs.getString("sender_username"),
                rs.getString("receiver_username"),
                  UserFeedbackLevel.valueOf(rs.getString("feedback_level")));
        
        return userFeedback;
        
    }
    
}
